package com.lagou.model;

import java.io.Serializable;
import java.util.Objects;

public class Questions implements Serializable {
    private static final long serialVersionUID = 2450043916959570716L;
    private String question;
    private String optionA;
    private String optionB;
    private String optionC;
    private String answer;
    private String score;

    public Questions() {
    }

    public Questions(String question, String score, String optionA, String optionB, String optionC, String answer) {
        this.question = question;
        this.score = score;
        this.optionA = optionA;
        this.optionB = optionB;
        this.optionC = optionC;
        this.answer = answer;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    public String getQuestion() {
        return question;
    }


    public void setQuestion(String question) {
        this.question = question;
    }

    public String getOptionA() {
        return optionA;
    }

    public void setOptionA(String optionA) {
        this.optionA = optionA;
    }

    public String getOptionB() {
        return optionB;
    }

    public void setOptionB(String optionB) {
        this.optionB = optionB;
    }

    public String getOptionC() {
        return optionC;
    }

    public void setOptionC(String optionC) {
        this.optionC = optionC;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    @Override
    public String toString() {
        return question + "(" + score + "分)" + "\n" +
                "A." + optionA + "\t\t" + "B." + optionB + "\t\t" + "C." + optionC;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Questions that = (Questions) o;
        return Objects.equals(answer, that.answer);
    }

    @Override
    public int hashCode() {
        return Objects.hash(answer);
    }
}
